import socket
from threading import Thread
from util import receiver_server
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.bind(("192.168.1.9",50000))

client.connect(("39.107.249.113",60000))
# 发送数据之前，客户端先启动一个多线程，用来一直循环不断接受服务端的消息
t = Thread(target=receiver_server, args=(client,))
t.start()
# 进行消息的发送
while True:
    msg = input("请输入你要发送的消息：")
    client.send(msg.encode("utf-8"))
